<?php
        session_start();
        $username = $_SESSION['username'];
      // echo "$username";

    // Define the full path to your folder from root
    $path = "C:\Users\Yongke\Desktop";

    // Open the folder
    $dir_handle = @opendir($path) or die("Unable to open $path");

    // Loop through the files
    while ($file = readdir($dir_handle)) {

    if($file == "." || $file == ".." || $file == "index.php" )

        continue;
        $path = "download.php?download_file=\\";
        $newpath = $path.$file;
        $ada = explode(".",$file);
        $i=0;
        for ($i==0;$i<array_sum($ada);$i++)
        {
            if ($ada[$i]=='.')
            {
            echo "<a href=\"$newpath\">$file</a><br />";
            }
             else
            {
            echo "<a href=\"$newpath\">$file</a><br />";echo"Hello";
            }
    }
        //echo "<a href=\"$newpath\">$file</a><br />";
        //echo "<a href=\"$file\">$file</a><br />";
    }
    closedir($dir_handle);
?>
